package api

import (
	"cron_table_admin/global"
	"cron_table_admin/internal/response"
	"cron_table_admin/mq"

	"github.com/gin-gonic/gin"
)

func UserLogin(c *gin.Context) error {
	//查询用户逻辑

	response.OkWithData("test success", c)
	return nil
}

// TestNsq 测试nsq
func TestNsq(c *gin.Context) error {
	p, err := mq.NewNsqProducer(global.SERVER_CONFIG.MqConfig.NsqAddress)
	if err != nil {
		response.FailWithMessage("UserLogin error", c)
		return err
	}
	if err = p.Publish("test", "test1"); err != nil {
		response.FailWithMessage("UserLogin error", c)
		return err
	}
	response.OkWithData("test success", c)
	return nil
}
